home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 10 - 1994 / 10.12 Dec 94 / ProgChal 12.94 / time.c
Encoding:
Text File  |  1994-10-13  |  5.0 KB  |  175 lines  |  [TEXT/KAHL]

  1. // TOP 5 EXCUSES WHY THIS PROJECT WAS LATE:                        
  2. //        1. "I though you said it was due NEXT month!"            
  3. //        2. The Product Manager quit after we missed the beta    
  4. //           acceptance deadline.                                    
  5. //         3. Somebody activated the fire alarm while we were        
  6. //           holding a brainstorming session, and all our            
  7. //           ideas were lost.                                        
  8. //        4. QA didn't keep us up to date on active bugs.            
  9. //        5. I just couldn't wait to try out the new game of        
  10. //           solitaire that came with System 7.5!
  11.  
  12. // The skill of the product manager is the key to a
  13. // successful product.        
  14. enum {
  15.     // Manager ratings. 
  16.     noManager = 0,
  17.     lazyManager = 1,
  18.     poorManager = 2,
  19.     okManager = 3,
  20.     motivatedManager = 4,
  21.     excellentManager = 5
  22. };
  23.  
  24. enum {
  25.     // System versions. 
  26.     system7 = 7,
  27.     system6 = 6,
  28.     system5 = 5,
  29.     system4 = 4,
  30.     system3 = 3,
  31.     system2 = 2,
  32.     system1 = 1
  33. };
  34.  
  35.  
  36. // It assumed that the better the manager is, the more lines
  37. // the engineers will be motivated to write.
  38. #define juniorLines            (100 + (20 * manager))
  39. #define seniorLines            (200 + (25 * manager))
  40.  
  41. // Every large project will have an overhead for planning,
  42. // designing, and preparing for development.
  43. #define overhead                (linesC / 5000)
  44.  
  45. // These ratios are based on Barne's matrix equations
  46. // related to the study of time-space software development
  47. // theorems. (trust me!)
  48. #define PPCNativeRatio            (float) \
  49.                                 (1.75 - (.02 * powerMacs))
  50. #define joltRatio                (float) (.7)
  51. #define systemSupportRatio        (float) \
  52.                                 (7.0 / systemSupport)
  53.  
  54. // Here again,the manager can motivate both QA and UI
  55. // people to be more productive.
  56. #define qaRatio        1 - (.1 + (.01 * manager) * qaPeople)
  57. #define uiRatio                (float) ((1.2 - \
  58.             (.01 * manager)) * (seniorEng - uiPeople))
  59.  
  60. // Localization- a nightmare. Enough said.
  61. #define localizedRatio            (float) (1.35 * localized)
  62.  
  63.  
  64. //             ***** SoftwareTimeEstimate *****
  65. //
  66. //   A simplified algorithm that accurately calculates
  67. // the time in calendar days for any Macintosh software
  68. // product to be completed.
  69. //
  70. //   The complete algorithm and collection of equations
  71. // can be found in E. Barne's
  72. //   'Estimation of Time-Space Development Theorems',
  73. // published by Academic Press.
  74. //
  75. // Implementation by Jeremy Vineyard,
  76. // Lawrence, KS
  77.  
  78.  
  79. unsigned short SoftwareTimeEstimate(linesC, seniorEng,
  80.     juniorEng, systemSupport, PPCNative, powerMacs, manager,
  81.     jolt, qaPeople, uiPeople, localized)
  82.     
  83.     // Estimated # lines of source code in C.
  84.     unsigned long linesC;
  85.  
  86.     // # of competent engineers with more than 5
  87.     // years experience.
  88.     unsigned short seniorEng;
  89.     
  90.     // # of junior engineers with less than 2
  91.     // years experience.
  92.     unsigned short juniorEng;
  93.  
  94.     // Earliest version of system software supported by
  95.     // product (1-7)
  96.     unsigned short systemSupport;
  97.  
  98.     // TRUE if product will be PowerPC native.
  99.     Boolean PPCNative;
  100.     
  101.     // # of PowerMacs available to developers (1-30).
  102.     unsigned short powerMacs;
  103.  
  104.     // Rating of manager 1-5 (1 is poor, 5 is excellent)
  105.     // or 0 if none.
  106.     unsigned short manager;
  107.  
  108.     // TRUE if company has steady supply of Jolt cola.
  109.     Boolean jolt;        
  110.             
  111.     // # of trained, in-house testers (most important).
  112.     unsigned short qaPeople;
  113.     
  114.     // # of people responsible for making decisions about UI.    
  115.     unsigned short uiPeople;
  116.         
  117.     // # of Languages product must be localized to before
  118.     // shipping or 0 if none.
  119.     unsigned short localized;    
  120. {
  121.     float            time, ratio;
  122.     short            linesADay;
  123.     
  124.  
  125.     // Calculate the lines of source code that can be 
  126.     // produced per day based upon the number of engineers 
  127.     // working on the product.
  128.     // (Must have at least one engineer)
  129.     linesADay = (seniorEng * seniorLines) + (juniorEng * juniorLines);
  130.     
  131.     // Estimate the # of days it will take to produce the    
  132.     // specified amount of code.                                
  133.     time = (linesC / linesADay) + overhead;
  134.     
  135.     // The farther backwards this product is compatible with             
  136.     // system versions, the more time it will take to develop.            
  137.     // systemSupport should be from 1 (System 1.0) to 7.
  138.     time *= systemSupportRatio;
  139.         
  140.     // More development & QA time will need to be spent on    
  141.     // a product that is PowerPC native. The more Power Macs
  142.     // that are available to developers, the faster the 
  143.     // development & testing process will proceed.                    
  144.     if (PPCNative)
  145.         time *= PPCNativeRatio;
  146.         
  147.     // o JOLT COLA!  o                                                        
  148.     // o GIve the PRogramMeRS that EXtra ZING! to geT thEm o
  149.     // o MOTIVATED!! o    
  150.     if (jolt)
  151.         time *= joltRatio;
  152.  
  153.     // Quality assurance is one of the most important         
  154.     // aspects of a product's construction.  Without it, the         
  155.     // product will fail to reach the user base because of 
  156.     // too many bugs. QA can never be overstaffed!                        
  157.     time *= qaRatio;    
  158.  
  159.     // User interface has a limited potential because people    
  160.     // are likely to have very set opinions, and if there 
  161.     // are too many UI people, it can kill a product. There     
  162.     // should never be more UI personnel than engineers.    
  163.     if (uiPeople > seniorEng)
  164.         time *= uiRatio;    
  165.  
  166.     // The more languages the product must be localized to
  167.     // before it can be shipped has a drastic effect on the
  168.     // development time.
  169.     if (localized)
  170.         time *= localizedRatio;
  171.     
  172.     return (short) time;
  173. }
  174.  
  175.